package com.boco.job;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;

@Service
public class SimpleJobDemo implements SimpleJob {

	private Logger log = LoggerFactory.getLogger(SimpleJobDemo.class);;

	@Override
	public void execute(ShardingContext shardingContext) {

		log.info(String.format("------Thread ID: %s, 任务总片数: %s, 当前分片项: %s",

				Thread.currentThread().getId(), shardingContext.getShardingTotalCount(),
				shardingContext.getShardingItem()));

	}
}
